Method and apparatus for fair queueing of data packets

ABSTRACT

A packet scheduling method and apparatus is described for enqueuing incoming data packets in sessions, and for storing the sessions in sequential order in service-groups. Each service-group is assigned a nominal service-interval in which time a data packet is to be transmitted, the nominal service-interval of one service-group being faster than the nominal service-interval of another service-group. Within one service-group, one session is serviced until the nominal service-interval of any of the service-groups where there is at least one data packet to be sent is exceeded.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to a method and apparatus for scheduling transmission of data packets in a packet network. More particularly, the present invention relates to a scheduler that can be used in high-speed traffic management equipment.

[0003] 2. State of the Art

[0004] In packet networks, data is transmitted in variable-length packets from source to destination through network elements such as routers and switches. In general, there is a need for buffering data at these intermediate network elements because there may be a mismatch between offered (bandwidth presented to the network element) and available bandwidth on links attached to these network elements. The handling of packets in and out of these buffers is referred to as Traffic Management.

[0005] Part of Traffic Management is a scheduling discipline. This is an algorithm that selects a packet out of a pool of buffered packets to be transmitted. In a packet network where one wishes to guarantee minimum bandwidth and delay to certain traffic flows, or put “firewalls” between competing traffic flows, the choice of an appropriate scheduling discipline is essential. Other equally important components of traffic management, such as congestion control, need to complement the scheduling discipline to avoid the unfair monopolization of buffering resources.

[0006] The Internet Engineering Task Force (IETF) has proposed an Integrated Services framework (IETF RFC 1633) which provides the ability to guarantee minimum bandwidth and delay to a traffic flow in an IP network. While deployment of such a service may not be desired, practical or feasible on a wide area network such as the Internet, because of scalability, stability and robustness, it may be a useful tool in smaller networks or in networks that aggregate packet data traffic with other traditional telecom services.

[0007] With the advent of Multiprotocol Label Switching (MPLS), there is a genuine opportunity for IP networks to be deployed as a multi-service network. MPLS considerably simplifies per-flow classification in a data path compared to the orginal Integrated Services (IntServ) specification. IntServ is a protocol developed by the IETF to provide Quality of Service (QoS) over the internet. Quality of Service is the idea that transmission rates, error rates, and other characteristics can be measured, improved, and, to some extent, guaranteed in advance of transmission. QoS is of particular concern for the continuous transmission of high-bandwidth video and multimedia information.

[0008] In the book “An engineering approach to computer networking”, ISBN 0201634422, S. Keshav describes general principles relating to scheduling operations. One known scheduling discipline is known as Generalized Processor Sharing (GPS). GPS is an ideal (and often unimplementable) work-conserving scheduling discipline that achieves a maximum-minimum weighted fair share (WFS) allocation of bandwidth. Quite a number of other scheduling disciplines have attempted to approximate GPS. The most noteworthy are Weighted Fair Queueing (WFQ), Self-Clocked Fair Queueing (SCFQ), Start-time Fair Queueing also known as Stochastic Fair Queueing (SFQ), Virtual Clock (VC), Worst-Case Weighted Fair Queueing (WF²Q) and DRR (Deficit Round Robin).

[0009] The first proposed approximation of GPS was WFQ, which is described in “Analysis and simulation of a fair-queueing algorithm”, by Demers, S. Keshav and S. Shenker in proceedings of ACM SIGCOMM '89, p. 1-12, Austin, Tex., September 1989. This approximation computes, based on a virtual time, the finish times for packets and then sorts packets so that they are sent out with the smallest finish time first. To calculate the finish-times, it keeps track of the equivalent GPS system.

[0010] SCFQ, as described by S. J. Golestani in “A self-clocked fair queueing scheme for broadband applications”, in proceedings of IEEE INFOCOM '94, vol. 2, p. 643-646, June 1994, and SFQ, as described by P. Goyal, H. M. Vin and H. Chen in “Start-time fair queueing: a scheduling algorithm for integrated service access”, in proceedings of ACM SIGCOMM '96, August 1996, avoid this latter complexity of WFQ by approximating the way the finish time is computed. Although a Relative-Fairness-Bound has been derived for SCFQ, it has a worst-case latency that is proportional to the number of sessions. SFQ improves on SCFQ by having a bounded worst-case latency.

[0011] Virtual Clock (VC), as described by L. Zhang in “Virtual clock: a new traffic control algorithm for packet switching networks”, is an algorithm similar to WFQ, but the finish-time computation is simplified by using the real time instead of a virtual time (tracking the state of the GPS system). Because of this, however, the long-term unfairness of VC is not bounded.

[0012] WF²Q, as described by Jon C. R. Bennett and Hui Zhang in “WF²Q; Worst-case Fair Weighted Fair Queueing”, INFOCOM '96, pages 120-128, March 1996, is the highest quality approximation of WFQ, but requires sorting of packets with respect to both start time and finish time. WF²Q+ retains all properties of WF²Q, but without the explicit need to track the state of the GPS system. It provides both firm Relative-Fairness-Bounds and Absolute-Fairness-Bounds.

[0013] Each of these algorithms discussed hereinabove requires a way to sort sessions, which is an operation of the order O(log N), with N the number of sessions. In “Implementing scheduling algorithms in high speed networks” by D. Stephens, J. Bennett and H. Zhang, IEEE Journal on Selected Areas in Communications, p. 1145-1158, 17(6), 1999, a framework is discussed for high-speed implementations of various WFQ approximations, including WF²Q+. There, the idea of a logarthmic scale of groups is introduced, where each group holds sessions that have a similar service-interval. However, within each group, there is a sorting mechanism (using calendar queues). In “Hardware-efficient fair queueing architectures for high-speed networks”, Infocom (2), pages 638-646, 1996, Jennifer Rexford, Albert G. Greenberg and Flavio Bonomi followed a similar approach for SCFQ algorithms; however sorting bins are required within each group.

[0014] DRR, described by M. Shreedhar and George Varghese in “Efficient fair queueing using Deficit Round Robin”, SIGCOMM '95, pages 231-242, 1995, approximates GPS in a low-cost way. It extends Round-Robin (which is a GPS approximation for fixed-size packets) to work correctly for variable-size packets. DRR, like RR, does not require sorting logic. Also, it does not need to calculate a complex virtual-time function. However, DRR only offers long-term fairness, and has a delay-bound that is proportional to the number of sessions.

[0015] Hemant Chaskar and Upamanyu Madhow take an alternative approach in “Fair scheduling with tunable latency: a round robin approach”, http://citeseer.nj.nec.com/cheskar99fair.html, to implement a fair scheduler for fixed-size packets. Starting from Hierarchical Round Robin, a low-cost fair scheduler is derived with properties as good as WF²Q, called Multiclass WRR. Chasker and Madhow also suggest that a variabl;e length packet scheduler can be developed along the same lines as DRR. Hierarchical Deficit Round Robin (HDRR) can be considered as a native packet variant of Multiclass WRR, since the concept of service-groups, a hierarchical round-robin selection, and a mechanism to make sure that faster classes are served within a bounded delay are also introduced.

[0016] The Generalised Processor Sharing (GPS) discipline and its packet approximations, Fair Queueing (FQ), Weighted Fair Queueing (WFQ) and variants, are popular scheduling disciplines because of their useful properties with respect to bandwidth, proportional fairness, and delay. However, they are very complex to implement at high speeds. For example, an OC-192c SONET fiber, carrying a single channel of Packet-over-Sonet (PoS) IP packets, can transmit up to 25 Million Packets per second, it all the packets were the smallest 40B IP packets. This means that, in a Worst case situation, the scheduler must make a new scheduling decision every 40 ns.

[0017] The complexity for implementing WFQ-like disciplines mainly arises from two aspects: computing the timestamps, and sorting the sessions based on the timestamps. Some GPS approximations such as SCFQ and SFQ succesfully avoid the complex timestamp computation, but all existing solutions require sorting of sessions. Since this is very difficult and/or somewhat expensive to implement in hardware, cheaper and simpler alternatives such as DRR are favored for high-speed hardware designs. Deficit Round Robin does not require a sorting operation, but has no way to tune latency given to individual flows, and does not provide short-term fairness.

[0018] There is a need for a packet scheduling method and apparatus which provides both long-term and short-term fairness and at the same time is inexpensive to implement.

SUMMARY OF THE INVENTION

[0019] The above objectives are accomplished by a method and apparatus according to the present invention.

[0020] The present invention provides a packet scheduling discipline called Hierarhical Deficit Round Robin (HDRR), which approximates the GPS discipline. Compared to existing approximations of GPS (such as WFQ, WF²Q, SCFQ, SFQ), HDRR does not require a session sorting operation, and thus has a much lower complexity, making it well-suited for high speed hardware implementations. However, unlike other low complexity approximations such as DRR, HDRR retains all the desirable properties of GPS, such as (a) instantaneous fair allocation of bandwidth to back-logged sessions, and (b) service to leaky-bucket constrained sessions with a delay-bound independent of the number of sessions.

[0021] The present invention provides a packet scheduling method comprising the steps of:

[0022] enqueuing incoming data packets in sessions,

[0023] storing the sessions in sequential order in service-groups, each service-group being assigned a nominal service-interval in which time a data packet is to be transmitted, the nominal service-interval of one service-group being faster than the nominal service-interval of another service-group, and

[0024] within one service-group, servicing one session until the nominal service-interval of any of the service-groups where there is at least one data packet to be sent is exceeded.

[0025] This procedure has the advantage that service is provided efficiently by dealing with one session but that change to another session is triggered whenever the nominal service interval for other service-groups is exceeded, i.e. when there is a need to change service group to maintain short term fairness.

[0026] Each data packet can have a priority for selection if the nominal service-interval of a service-group is exceeded and if a data packet from that service-group is not selected, then its priority for a next selection can be changed such as to give it a higher priority. This again improves short-term fairness.

[0027] The service-interval can be measured in accordance with virtual time, which virtual time is incremented in accordance with the time expected for transmission of the next packet to be sent. Alternatively, the service-interval can be measured in accordance with virtual time, which virtual time is incremented in accordance with the time for transmission of the latest packet sent. The use of a virtual time allows rational scheduling of packets even when the real time of service differs greatly from the expected time of service.

[0028] Each service-group may comprise a current session list and at least one new session list, in which case the method may further comprise:

[0029] holding a virtual time value,

[0030] in at least one of the service-groups, holding at least one session comprising at least a head-of-session data packet, the session having a required service-interval for its head-of-session data packet, sessions requiring different service-intervals for their head-of-session data packets being held in different service-groups,

[0031] at integer values of the virtual time value, swapping the new session lists into the current session lists for service-groups which may receive service at that virtual time value, if the current session list for that service-group is empty, and increasing a MissedSwaps counter for that service-group if the current session list for that service-group was not empty,

[0032] transmitting the head-of-session data packet from a session in a current session list,

[0033] scheduling transmission of the next data packet from that session based on the required service-interval of the previous data packet and a service interval it was actually given, and on the value of the MissedSwaps counter,

[0034] increasing the virtual time value, and

[0035] repeating the transmitting and increasing steps as long as the virtual time does not reach a next integer value, otherwise repeating the swapping step. By swapping at integer times a compromise is reached between short-term and long-term fairness.

[0036] The present invention also provides a packet scheduling apparatus comprising

[0037] an input device for receiving incoming data packets belonging to at least one session,

[0038] a bank of memories comprising memory sets for storing the incoming data packets, the memory sets having a nominal service-interval in which time a data packet is to be transmitted, the nominal service-interval of one memory set being faster than the nominal service-interval of another memory set,

[0039] an output device for transmitting the stored data packets,

[0040] a processing element linked to the input device, the output device and the bank of memories for scheduling sessions to be serviced until the nominal service-interval of any of the memory sets where there is at least one data packet to be sent, is exceeded.

[0041] Each data packet may have a priority value for selection, in which case the apparatus may furthermore comprise a priority switcher for changing the priority value of a data packet for a next selection such as to give it a higher priority value if the nominal service-interval of a memory set is exceeded and if a data packet stored in that memory set is not selected.

[0042] The apparatus may furthermore comprise a timing unit for measuring the service-interval in accordance with virtual time, which virtual time is incremented in accordance with the time expected for transmission of the next packet to be sent.

[0043] Each memory set may comprise a current session list memory and at least one new session list memory for holding data packets, in which case the apparatus furthermore comprises:

[0044] input means for inputting arriving data packets into the memory sets, the data packets having a required service-interval,

[0045] a timing unit for holding a virtual time value,

[0046] means for swapping the content of the new session list memories into the current session list memories at integer values of the virtual time value, for memory sets which may receive service at that virtual time value, if the current session list memory for that memory set is empty, and a MissedSwaps counter for that memory set to be increased if the current session list memory for that memory set was not empty,

[0047] means for transmitting data packets from a current session list memory, and

[0048] a scheduler for scheduling transmission of a next data packet from that memory set based on the required service-interval of the next data packet to be sent, and on the value of the MissedSwaps counter.

[0049] The apparatus may furthermore comprise a timing unit for measuring the service-interval in accordance with virtual time, which virtual time is incremented in accordance with the time for transmission of the latest packet sent.

[0050] Each memory set may comprise a current session list memory and at least one new session list memory for holding data packets, in which case the apparatus may furthermore comprise:

[0051] input means for inputting arriving data packets into the memory sets, the data packets having a required service-interval,

[0052] a timing unit for holding a virtual time value,

[0053] means for swapping the content of the new session list memories into the current session list memories at integer values of the virtual time value, for memory sets which may receive service at that virtual time value, if the current session list memory for that memory set is empty, and a MissedSwaps counter for that memory set to be increased if the current session list memory for that memory set was not empty,

[0054] means for transmitting data packets from a current session list memory, and

[0055] a scheduler for scheduling transmission of a next data packet from that memory set based on the required service-interval of the previous data packet and a service interval it was actually given, and on the value of the MissedSwaps counter.

[0056] These and other characteristics, features and advantages of the present invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, which illustrate, by way of example, the principles of the invention. This description is given for the sake of example only, without limiting the scope of the invention. The reference figures quoted below refer to the attached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

[0057]FIG. 1 illustrates a reference model for a packet scheduler within a traffic management component.

[0058]FIG. 2 illustrates an exemplary organisation of a traffic management component at a node of a packet switched network.

[0059]FIG. 3 illustrates decision moments for different service-groups according to an embodiment of the invention.

[0060]FIG. 4-FIG. 17 illustrate different stages in a process flow of a scheduling method according to an embodiment of the invention.

[0061]FIG. 18 is a schematic representation of an embodiment of the invention including an embedded processor and memory.

[0062]FIG. 19 is a schematic representation of an embodiment of the present invention including digital logic and memories.

DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

[0063] Turning now to FIG. 1, a scheduler 4 is part of a traffic manager 1, allocated to a particular transmission line, at a node of packat switched network. The packet switched network may be any packet switched network such as a landline telecommunications network or a mobile radio telecommunications network. Packet switched networks can be divided into those which allow an independent decision of the routing of a packet at each node (datagram systems) and those which set up a virtual circuit through the network and deliver packets along these virtual networks (virtual circuit systems). In any such system packets need to be buffered at various places in the system in order to deal with varying transmission rates and output port contention.

[0064] With reference to FIG. 2, packets enter the traffic management system with additional information such as destination queue, in a packet receive unit A. The packet receive unit A requests one or more free buffers from a buffer management unit B. The packet is enqueued by means of a descriptor, for instance, into a packet queue management unit C, while the packet itself is sent to a memory controller D, e.g. DRAM controller, which stores it in a memory E such as a DRAM.

[0065] A packet scheduler 1 inside the packet queue management unit C schedules a packet for transmission and de-queues the packet descriptor from its data structures. This is forwarded to a packet transmit unit F, which requests the memory controller B to retrieve the packet from the memory C. Subsequently, the buffer or buffers containing the packet are freed, and the packet is transmitted.

[0066] In one aspect, the present invention concerns the packet scheduler 1 and a method for operating it.

[0067] According to the invention, each Incoming packet 2 that arrives for enqueueing in the scheduler 1 has been classified into a session. A session is defined as a flow of packets that require a particular service, and thus its packets may be reordered with respect to packets of other sessions to accomplish this service treatment. However, the packets within a single session generally will not be reordered. The scheduler 1 maintains per-session queues s₁, . . . s_(n) in which these packets are queued. Sessions that hold at least one packet are back-logged; otherwise they are idle. The scheduling discipline according to the invention decides which packet 3 to transmit. Only head-of-session packets are considered by the scheduler 1. Thus, the scheduler 1 decides which back-logged session to service.

[0068] A data-structure for a scheduling method according to the invention includes an array of N service-groups sg₀, . . . , sg_(N1). A service-group includes sessions that require a similar service-interval for their head-of-session packet. The service-interval SI (unit: s) is the amount of virtual time that (ideally) elapses between the transmission of two consecutive packets for the session. As shown in Equation (1), the SI is a function of the session's rate R_(i) (unit: Byte/s) and the packet length L (unit: Byte). $\begin{matrix} {{SI} = \frac{L}{R_{i}}} & (1) \end{matrix}$

[0069] While reference is made to the (guaranteed) rate (R_(i)) of a session, more correctly this value specifies a “weight”. Each back-logged session will receive service in accordance with this weight, while the scheduler 1 tries to use all available bandwidth. The service that a session has received is the amount of data (in Bytes) that the scheduler 1 has transmitted for a session.

[0070] The virtual time keeps track of the progress of time, but differs from the real time by taking into account the number of back-logged sessions and their weights. The smaller the total weight of all back-logged sessions, the faster the virtual time progresses. With respect to the virtual time, every session transmits at its guaranteed rate, which means that with respect to real time, every session will transmit at its weighted fair rate.

[0071] Weighted fairness, the notion that every session needs to receive its fair share of service, can be measured by comparing the weighted service that is given to sessions, over a period of time, P as shown in Equation (2) where the sum is the amount of service given during the period P. The closer this value is to 1, the the fairer the service given to these sessions. $\begin{matrix} {{{Fairness}\quad i\quad {vs}\quad j} = \frac{\frac{\sum\limits_{P}^{\quad}\quad L_{i}}{R_{i}}}{\frac{\sum\limits_{P}^{\quad}\quad L_{j}}{R_{j}}}} & (2) \end{matrix}$

[0072] With respect to fairness, a scheduler can exhibit two distinct qualities: long term fairness and short term fairness. Long-term fairness is related to the situation where P→∞ and measures whether a scheduler will eventually give the right service to each session. Long-term fairness thus measures how well, on a longer time-scale, the scheduler isolates flows from each other. Short-term fairness is related to the situation where P→0, and measures whether the scheduler gives fair service to each session on a short time-scale. Short-term fairness is an important property since a short-term fair scheduler reduces the burstiness of the bandwidth that each connection perceives; and because of that, it reduces the amount of buffering needed within network nodes. It also has important end-to-end implications since it reduces the worst-case latency that is experienced by packets, and it gives the end-to-end flow-control mechanisms (such as TCP, the Internet Transmission Control Protocol, RFC 793) a better opportunity to estimate available bandwidth, improving link usage and application performance and robustness.

[0073] According to the invention, the service-intervals associated with service-groups are preferably chosen on a logarithmic scale, e.g. SI_(sgi)=2^(i)_SI_(sg0). A logarithmic scale with base 2 is presently used. However, the choice of a logarithmic scale with base 2 is arbitrary, and the methods of the present invention can be implemented other logarithmic bases as well.

[0074] For the purpose of comparing service-groups it is defined that the rate of sg_(i) is faster than the rate of sg_(j) if i<j. After servicing a session in a service-group i, if the session is still back-logged, the session moves to a new service-group which is in general different from service-group i. A continously back-logged session moves between service-groups so that the scheduler according to the present invention assures long-term weighted fairness for all sessions.

[0075] Each service-group keeps track of two or more session lists: a current session list (CurrentSessionList) and a number of new session lists (NewSessionList). A session is always enqueued in one of the NewSessionLists, and the scheduler will service sessions that are present in the CurrentSessionLists. Using a well-controlled mechanism, the contents of particular NewSessionLists are transferred to the CurrentSessionList of that service-group, making the sessions available for service.

[0076] Whenever the scheduler transmits a packet, it makes a choice based on available sessions in the CurrentSessionLists in the following way: it picks the first packet from the CurrentSessionList in the fastest service-group that has a non-empty CurrentSessionList. Whenever a session is serviced, it is removed from that CurrentSessionList and possibly added to a NewSessionList of some service-group, if the session is still back-logged.

[0077] The scheduler maintains a monotonically increasing integer virtual time, VTfor transferring the contents of NewSessionLists to CurrentSessionLists. The MayService(sg_(i), VT) function determines whether sessions in group sg_(i) may receive service at virtual time VT. This function is defined as shown in Equation (3).

MayService(sg_(i),VT)=true if VT mod 2^(i)0  (3)

[0078] According to the present invention, the virtual time VT may be increased for two reasons. VT is increased at every packet transmission based on the time required to transmit that packet, taking into account the total weight of all back-logged sessions. Alternatively, VT may be increased when all the CurrentSessionLists are empty, but not all of the NewSessionLists.

[0079] When VT reaches a value that re-triggers a number of service-groups, i.e. each service-group for which MayService(sg_(i), VT)=true, the respective first NewSessionLists are swapped into the CurrentSessionLists for these groups, and each of the other NewSessionLists are swapped into their precessor. As a result, sessions become available for servicing.

[0080] However, the swapping of the session lists is not always possible for all service-groups, e.g. when the CurrentSessionList is not empty, there is no swap. The reason why the CurrentSessionList may not be empty is because the SI for the service-group may only be an approximation of the desired SI for each session in the group. On the other hand, VT will be increased based on the actual packet length of the packet being transmitted, and the actual weights of the back-logged sessions. One way to resolve this is to refuse to increase VT as long as any of the service-groups that would be triggered by the increase of VT has a non-empty CurrentSessionList. This, however, can potentially defeat the whole effort to add short-term fairness to the algorithm. The way this is solved according to the present invention is to tolerate that groups with non-empty CurrentSessionLists miss their swap of NewSessionList to CurrentSessionList.

[0081] Therefore, each service-group has a counter called MissedSwaps that keeps track of the number of swaps that a service-group has missed. In addition, each service-group has a number of NewSessionLists, each corresponding to a value of the MissedSwaps counter. The value of the MissedSwaps counter indicates which of the NewSessionLists must be used when enqueueing sessions into a service-group. A real implementation may bound the maximum number of swaps a service-group may miss (MaxMissedSwaps), and therefore also bound the number of NewSessionLists to MaxMissedSwaps+1. Each time an increase of VTwould need to swap a service-group but that service-groups CurrentSessionList is not empty, the MissedSwaps counter is increased. When an increase of VT would increase the MissedSwaps counter for a service-group over the value of MaxMissedSwaps, the increase of VT is then preferably prevented until the scheduler has emptied that service-groups CurrentSessionList (which will decrease the value of MaxMissedSwaps as will be shown later).

[0082] As mentioned above, there are the two ways for increasing VT. First of all, it may happen that all of the CurrentSessionLists are empty (because each time a packet is transmitted, its session gets removed from these lists). When some NewSessionList is not empty, then the value of VT is increased so that at least one service-group with non-empty NewSessionList swaps its lists. If sg_(i) is the fastest service-group with a non-empty NewSessionList, then the new time VT, which is the smallest time (greater than the current value) for which at least one service-group will service at least one session, can be expressed as shown in Equation (4).

VT←(└VT×2^(−i)┘+1)×2^(i)  (4)

[0083] Secondly, VT is updated gradually at each packet transmission time. The integer quantity VT, with its effect on how service-groups are triggered is complemented by a floating-point quantity (VTF) such that the sum of the two quantities tracks the virtual time (vt=VT+VTF) which is updated at each packet transmission as shown in Equation (5) where L is the length of the data packet to be transmitted, and TotalRate is the sum of the guaranteed rates for all currently back-logged sessions. $\begin{matrix} \left. {vt}\leftarrow{{vt} + \frac{L}{{TotalRate} \times {SI}_{sg0}}} \right. & (5) \end{matrix}$

[0084] Each time vt is updated, the values of VT and VTF are adjusted so that VT is increased maximally while swapping the appropriate service-groups, and VTF is the residu. It may happen that VT cannot be increased beyond certain values for reasons as discussed earlier: e.g. when a service-group has reached its maximum number of missed swaps. The effect of this gradual increase of VT is that the scheduler interrupts the servicing of slower service-groups by giving the appropriate service to faster service-groups.

[0085] The following discussion describes how a session is enqueued into a NewSessionList of a service-group, and the calculations that take place when a packet is dequeued. First it is described how a service-group is selected for (a) a session that has received service and moves to a new service-group because the session still is back-logged, or (b) a session that becomes back-logged because a new packet arrives for it.

[0086] Every session s_(i) stores an RSI_(i) (Required Service Interval) quantity for this purpose. The value of RSI is updated when a session is enqueued in a service-group, or when a data packet is transmitted and thus a session is dequeued from a service-group.

[0087] When a session gets dequeued, the value of RSI for that session may be updated to adjust when a packet gets dequeued from a service-group that has non-zero MissedSwaps as illustrated in Equation (6) below.

RSI_(i)←RSI_(i)−MissedSwaps_(sgj)×SI_(sgi)  (6)

[0088] This calculation provides that if it has taken too long to send a data packet from a service-group, which can be seen from a non-zero MissedSwaps counter for that service-group, the missed service is remedied at the next data packet.

[0089] If after giving service to a session s_(i) the CurrentSessionList becomes empty, missed swaps, if they exist for this service-group, are processed as follows: the first NewSessionList is swapped into the CurrentSessionList, all NewSessionLists get swapped into preceeding NewSessionList, and the MissedSwaps counter is decremented. This may be repeated until the MissedSwaps counter is 0 or the CurrentSessionList is not empty.

[0090] In the case where a session moves to another service-group, the current value of RSI (possibly containing a residu from previous iterations) is preferably updated based on the required service for the head-of-session packet as illustrated in Equation (7) where L_(s) _(^(i)) is the length of the head-of-session packet for session s_(i). $\begin{matrix} \left. {RSI}_{i}\leftarrow{{RSI}_{i} + \frac{L_{si}}{R_{i}}} \right. & (7) \end{matrix}$

[0091] Alternatively, though not presently preferred, the current value of RSI may be based on the service that was required for the latest sent (previous) data packet.

[0092] A new service-group sg_(j) for session s_(i), that just has been serviced (in service-group sg_(k)), is defined by Equation (8) (if RSI>0) with SI_(sg) _(⁰) the service interval associated with service-group 0: $\begin{matrix} {j = \left\lfloor {\log_{2}\left( \frac{{RSI}_{i}}{{SI}_{sg0}} \right)} \right\rfloor} & (8) \end{matrix}$

[0093] When the value of RSI of session s_(i) becomes negative (because e.g. the actual service given to the data packet, ASI, was far bigger than the desired service-interval RSI, or the service-group in which the session was had missed swaps, and thus service), that session s_(i) keeps receiving service until the value of RSI becomes positive again. While doing that, RSI is updated using the same formulas (see above and below), but using a value of 0 for ASI.

[0094] When a session moves, after transmission of its head-of-session packet, to a new service-group, it is put in one of that group's NewSessionLists. To adjust for the inaccuracy in the actual service interval given, the RSI value is updated with ASI (Actual Service Interval) by accounting for the service interval it was actually given (in service-group sg_(k)) as illustrated in the pair of Equations (9). $\begin{matrix} \left\{ \begin{matrix} \left. {ASI}\leftarrow{{SI}_{sg0} \times 2^{j}} \right. & {{{for}\quad j} = k} \\ \left. {ASI}\leftarrow{{SI}_{sg0} \times \left\lbrack {{\left( {\left\lfloor {{VT} \times 2^{- j}} \right\rfloor + 1} \right) \times 2^{j}} - {\left\lfloor {{VT} \times 2^{- k}} \right\rfloor \times 2^{k}}} \right\rbrack} \right. & {{{for}\quad j} \neq k} \end{matrix} \right. & (9) \end{matrix}$

[0095] The second calculation takes into account the value of VT which will trigger the new service-group j to be serviced. These calculations are shown graphically in FIG. 3.

[0096] Using the above value of ASI, RSI_(i) is updated according to Equation (10).

RSI_(i)←RSI_(i)−ASI  (10)

[0097] When enqueueing a session in a service group, it is enqueued in the last NewSessionList, based on the MissedSwaps value for that service group.

[0098] When a session s_(i) was idle and becomes back-logged, negative values of RSI are discarded by resetting RSI to 0 as illustrated in Equation (11).

RSI_(i)←max(RSI_(i),0)  (11)

[0099] In this way, there will never be given too much service to a session that continuously toggles between idle and back-logged.

[0100] After resetting RSI to 0, the same group selection as described above is still used. Thus, the service-group is based on information of the head-of-session packet that is to be transmitted.

[0101] For the very first packet of a session, the value of RSI can be initialised to 0. For the alternative update strategy for RSI based on the service for the latest packet, , for the very first packet of a session, the value of RSI can be initialised as shown in Equation (12) where L_(avg) is the average packet length of session s_(i). $\begin{matrix} \left. {RSI}_{i}\leftarrow\frac{L_{avg}}{R_{i}} \right. & (12) \end{matrix}$

[0102] The number of service-groups N affects the dynamic range of the scheduler (which is the product of the dynamic range of packet sizes and rates). The service interval for the fastest service group SI_(sg) _(⁰) , sets the bound of this dynamic range to an absolute value (i.e. for the smallest packet at the fastest transmission rate).

[0103] In the scheduling method according to the present invention that service-groups are given service starting with the fastest group. Moreover, service-groups are given service as long as its CurrentSessionList is not empty, regardless of the value of VT (which may increase while the CurrentSessionList is not empty).

[0104] When discussing implementation complexity of the scheduler of the present invention, it is important to consider both time complexity and memory complexity. With respect to the number of sessions, the time complexity of the scheduler of the present invention is O(1). Equally important however, is the bandwidth required for the data-structures in the algorithm. The scheduler of the present invention requires significant bandwidth for the service-group data-structure, since these need to be scanned for a non-empty CurrentSessionList.

[0105] The total number of service-groups is limited. For example, a range of rates of 2²⁰ and a range of packet sizes of 2¹² requires 32 service-groups. This can be further tuned by the chosen logarithmic base that, as an example, was set 2 for the present description. As the total number of service-groups is limited, the total state is relatively small. As a consequence this high-bandwidth memory can be kept on-chip. This contrasts with other WFQ approximations that require a mechanism to sort sessions. Clever implementations (such as proposed by D. Stephens, J. Bennett and H. Zhang in “Implementing scheduling algorithms in high speed networks”, 1999) offer solutions that can do this sorting operation in bounded time, but only by requiring high bandwidth for a relatively large amount of per-scheduler state (such as calendars), and by introducing also a considerable inaccuracy.

[0106] With respect to the CurrentSessionList and the multiple of NewSessionLists, it can be observed that sessions are only de-queued from the head of the CurrentSessionLists, and appended at the tail of the last NewSessionLists. This greatly simplifies the implementation of this data-structure.

[0107] Furthermore, a careful implementation of the invention does not require any division operations.

[0108] A scheduling method or scheduling scheme according to an embodiment of the present invention is functionally described in pseudo-code below.

[0109] Procedure HDRRenque(p,s) is called for each arriving packet p belonging to a session s.

[0110] procedure HDRRenque(p,s) 1: enque(p,s) 2: if length(s)=1 then 3:    TotalRate

TotalRate + rate(s) 4:    phi

length(p)/rate(s) 5:    RSI(s)

max(RSI(s),0) 6:    RSI(s)

RSI(s) + phi 7:    group

findgroup(RSI(s)) 8:    ASI

SI_(sg°)_2^(group) 9:    RSI(s)

RSI(s) − ASI 10:   enque(s,NSL(group)[MS(group)]) 11: end if

[0111] When the session s to which packet p belongs was idle and becomes back-logged, it is inserted into the service-group structure of the present invention (lines 2-10). TotalRate is updated to include the rate of this session. If the session s to which packet p belongs was not idle, i.e. already contained packets, then TotalRate does not change, and packet p is simply enqueued in session s which is already enqueued in a session list within a service-group.

[0112] Line 5 makes sure that when a session had not received its instantaneous fair rate (a negative value for RSI(s)) in the past, but nevertheless became idle, the scheduler does not try to make up for this. On the other hand, when the scheduler had given too much service to this session, this is accounted for since otherwise a session could receive too much service by cycling between idle and back-logged.

[0113] Lines 6-9 perform the calculations of updating the session RSI(s) and locating the service group for the session s.

[0114] Line 10, finally, enques the session s into the correct NewSessionList (NSL) within that service-group. This takes into account the number of MissedSwaps (MS) for this service-group.

[0115] Procedure findgroup(RSI), used in the procedure HDRRenque(p,s), calculates the appropriate group for a session that becomes back-logged. This procedure is illustrated in following pseudocode.

[0116] procedure findgroup(RSI) $1\text{:}\quad {Return}\left\lfloor {\log_{2}\left( \frac{RSI}{{SI}_{sg0}} \right)} \right\rfloor$

[0117] The scheduling and transmission of packets out of the group structure is described by the following pseudocode.

[0118] procedure scheduler 1: while true do 2:   while all CSLs are empty do 3:    if not all NSLs are empty then 4:     increase VT( ) 5:    else 6:     wait until packets arrive 7:    end if 8:   end while 9:   g

fastest group with non-empty CSL 10:  s

deque(CSL(g)) 11:  RSI(s)

RSI(s)MS(g)_SI_(sg) ^(g) 12:  while MS(g)>0 and CSL(g) is empty do 13:   shiftsessionlists(g) 14:  end while 15:  repeat 16:   p

deque(s) 17:   VTF <- VTF + length(p) / (TotalRate * SI_(sg0)) 18:   transmit(p) 19:   if session s is idle then 20:    TotalRate

TotalRaterate(s) 21:    sessiondone

true 22:   -Is- 23:    p

head(s) 24:    phi

length(p)/rate(s) 25:    RSI(s)

RSI(s) + phi 26:    if RSI(s)>0 then 27:     newg

findgroup(RSI(s)) 28:     ASI

actualservice(newg,g) 29:     RSI(s)

RSI(s)ASI 30:     enque(s,NSL(newg)[MS(newg)]) 31:     sessiondone

true 32:    else 33:     sessiondone

false 34:    end if 35:   end if 36:  until sessiondone= true 37:  updateVTwithVTF( ) 38: end while

[0119] Preferably, the scheduler algorithm is only interrupted for enqueueing incoming packets between lines 1 and 2 of the pseudocode algorithm as given above.

[0120] At line 4, VT is increased so that at least one group (the fastest one) with a non-empty NewSessionList NSL[0] swaps its NewSessionList NSL[0] into a CurrentSessionList CSL. If all CSL and all NSL[0] lists are empty, then the scheduler is idle, and waits for new packets to be enqueued (line 6).

[0121] Lines 9-10 pick the session for which a packet will be transmitted. At line 11, the RSI of the session is adjusted by taking into account a possibly increased ASI for the packet that will be transmitted, because of missed swaps for the group. The loop at lines 12-14 handles the case where a last session is dequeued for the group (out of the CSL) and swap operations that were missed in the past are processed.

[0122] The loop from line 15 to 36 transmits one or more packets for the session. More packets may be transmitted to make up for missed service because of missed swaps.

[0123] For every packet transmitted, the value of VTF is increased (at line 17), and finally VTis adjusted based on these increases (at line 37). Lines 23-34 deal with the next packet for the session. Either, the packet has to be transmitted immediately (line 33), or the session has to be reenqueued in a new service group (lines 27-31).

[0124] The procedure increaseVTO increases VT when all CSLs are empty, but there is at least one non-empty NSL. This procedure is illustrated in the following pseudocode.

[0125] procedure increaseVT( ) 1: g

fastest group with non-empty NSL[0] 2: newVT

(└VTx2^(−g) ┘+1) × 2^(g) 3: lastg

groupstoswap(VT,newVT) 4: VTF

0 5: VT

newVT 6: for i=0 to i=lastg do 7:   CSL(i)

NSL(i)[0] 8:   NSL(i)[0]

empty 9: end for

[0126] The procedure groupstoswap(oldVT,newVT) calculates up to which service-group the lists need to be swapped, because of the increase of VT from oldVTto newVT.

[0127] procedure groupstoswap(oldVT, newVT)

[0128] 1: mask←oldVT xor newVT

[0129] 2: Return position of most most significant bit of mask, with 0 the position of the Isb of mask

[0130] The procedure shiftsessionlists(g) shifts the session lists for group g.

[0131] procedure shiftsessionlists(g)

[0132] 1: CSL(g)←NSL(g)[0]

[0133] 2: for i=1 to i=MaxMissedSwaps do

[0134] 3: NSL(g)[i1]←NSL(g)[i]

[0135] 4: end for

[0136] 5: NSL(g)[MaxMissedSwaps]←empty

[0137] Procedure actualservice(newg,oldg) calculates the actual service a packet receives, when moving from group oldg to group newg, taking into account the current time VT:

[0138] procedure actualservice(newg, oldg)

[0139] 1: Return SI_(sg) _(⁰) ×[(└VT×2^(−newg)┘1)×2^(newg)−└VT×2^(−oldg)┘2^(oldg)]

[0140] Procedure updateVTwithVTF( ) updates the values of VT and VTF and possibly triggers new groups based on the increase of VT:

[0141] procedure updateVTwithVTF( )

[0142] 1: if all groups have empty CSL and NSL[0] then 1: if all groups have empty CSL and NSL[0] then 2:   VT

0 3:   VTF

0 4:   Return 5: end if 6: g

first group with non-empty CSL or NSL[0] 7: VTg

(└VT ×2^(−g) ┘+1)×2^(g) 8: if └VT + VTF ┘<VTg then 9:   Return 10: end if 11: lastg

groupstoswap(VT,VTg) 12: lastg

max(lastg,slowest group) 13: if there is a group i ≦ lastg with MS(i)=MaxMissedSwaps then 14:  Return 15: end if 16: newVT

VTg 17: VTF

VTF(newVTVT) 18: VT

newVT 19: for i=0 to i=lastg do 20:  if CSL(i) is not empty then 21:   MS(i)

MS(i) + 1 22:  else 23:   CSL(i)

NSL(i)[0] 24:   NSL(i)[0]

empty 25:  end if 26: end for

[0143] If the scheduler is empty, then the values of VT and VTF are reset (lines 1-5).

[0144] Next, the procedure will attempt to increase the value of VT so that the fastest group with a non-empty CSL or NSL[0] will swap its lists. This value of VT is calculated in line 7 as VTg.

[0145] Lines 8-10 handle the case where not enough data has been transmitted to be able to trigger this swap to happen. In that case the values of VT and VTF are left unchanged.

[0146] Lines 11-15 handle the case where VT cannot be increased to the value of VTg because one of the groups that would need to be swapped (up to lastg) has already reached its maximal amount of missed swaps. In this case, the need to increase VT is ignored. It is to be noted that this situation can be avoided by increasing the value of MaxMissedSwaps. Line 12 takes into account that the number of service-groups is finite

[0147] Finally, lines 16-26 handle the case where VT can be increased to VTg, and the resulting swap operations (lines 23-24), or increases of MS (line 20) are performed as a result of that.

[0148] What follows is a simulation, based on the above pseudo-code, with reference to the drawings in order to clarify what happens with different packets and/or sessions during the scheduling and transmission thereof.

[0149] As an example, four sessions will be considered:

[0150] session s0 with rate R0: 80 B/s

[0151] session s1 with rate R1: 160 B/s

[0152] session s2 with rate R2: 80 B/s

[0153] session s3 with rate R3: 40 B/s

[0154] It is assumed that all packets which belong to those sessions will have the same length: e.g. L=320 B.

[0155] /**procedure scheduler **/

[0156] At VT=0, all CSL and all NSL are empty. The system waits until packets arrive. This is shown in FIG. 4.

[0157] /** procedure HDRRenque (p,s) **/

[0158] Still at VT=0, packets p1 to p4, belonging to session s0 arrive as illustrated in FIG. 5.

[0159] Packet p1 is enqueued in session s0.

[0160] TotalRate=80 [B/s].

[0161] Phi=320/80=4

[0162] RSI(s0)=0; initialised as such for the very first packet of a session

[0163] RSI(s0)=0+4=4

[0164] Group=└log₂(4/2)┘=1; session s0 will be entered into SG1

[0165] ASI=2*2¹=4

[0166] RSI(s0)=4−4=0

[0167] s0 is enqueued in NSL[0] of SG1.

[0168] Packet p2 belonging to session s0 arrives and is enqueued in session s0.

[0169] Packet p3 belonging to session s0 arrives and is enqueued in session s0.

[0170] Packet p4 belonging to session s0 arrives and is enqueued in session s0.

[0171] The result is shown in FIG. 5.

[0172] /**procedure scheduler **/

[0173] Still at VT=0, all CSL are empty, but not all NSL[0] are empty: NSL[0] of SG1 contains 1 session s0 for which 4 packets p1, p2, p3, p4 have arrived.

[0174] /** procedure increaseVT( ) **/

[0175] g=1; SG1 is the fastest group with non-empty NSL[0]

[0176] newVT=(└VT*2^(−g)┘+1)*2^(g)=(└0*2⁻¹┘+1)*2¹=2

[0177] lastg=1; therefore SG0 and SG1 may swap the content of their NSL[0] into CSL

[0178] VTF=0

[0179] VT=2

[0180] The content of NSL(SG1)[0] is swapped into CSL(SG1), and the content of NSL(SG1)[0] is emptied as shown in FIG. 6

[0181] / ** procedure scheduler **/

[0182] g=1; SG1 is the fastest (and the only) group with CSL non-empty.

[0183] There is only 1 session s0 in SG1 from which packets need to be transmitted. This session, s0, is selected.

[0184] RSI(s0)=0

[0185] Packet p1 is dequeued from s0, its length is obtained, and

[0186] VTF=0+320/(80*2)=2.

[0187] Packet p1 is transmitted, and packet p2 becomes the next packet to be transmitted as shown in FIG. 7a.

[0188] Phi=320/80=4[s].

[0189] RSI(s0)=0+4=4[s].

[0190] Newg=findgroup (4)=└log₂(4/2)┘=└log₂2┘=1

[0191] ASI=actualservice(1, 1)=2*((└2*2⁻¹┘+1)*2¹−└2*2⁻┘*2¹)=4

[0192] RSI(s0)=4−4=0

[0193] Session s0 is enqueued in the NSL[0] of group SG1. The result is shown in FIG. 7b.

[0194] /** procedure update VT with VTF( ) **/

[0195] VT is updated with VTF:

[0196] g=1; SG1 is the first group with non-empty CSL or NSL[0]

[0197] VTg=(└T*2⁻¹┘+1)*2¹=(1+1)*2=4

[0198] VT is equal to 2; VT+VTF=2+2=4

[0199] Lastg=2

[0200] NewVT=4

[0201] VTF=2−(4−2)=0

[0202] VT=4

[0203] NSL(SG0)[0] is swapped to CSL(SG0) and NSL(SG0)[0] is emptied

[0204] NSL(SG1)[0] is swapped to CSL(SG1) and NSL(SG1)[0] is emptied

[0205] NSL(SG2)[0] is swapped to CSL(SG2) and NSL(SG2)[0] is emptied

[0206] The result is shown in FIG. 7c.

[0207] /** procedure scheduler **/

[0208] g=1; SG1 is the fastest (and the only) group with CSL non-empty.

[0209] There is only one session s0 in SG1 from which packets need to be transmitted. This session s0 is selected.

[0210] RSI(s0 )=0

[0211] Packet p2 is dequeued from s0, its length is obtained, and

[0212] VTF=0+320/(80*2)=2.

[0213] Packet p2 is transmitted, and packet p3 becomes the next packet to be transmitted, as shown in FIG. 7d.

[0214] Phi=320/80=4[s].

[0215] RSI(s0 )=0+4=4[s].

[0216] Newg=findgroup (4)=└log₂(4/2)┘=└log₂┘=1

[0217] ASI=actualservice (1, 1)=2*((└4*2⁻¹┘+1)*2¹−└4*2⁻¹┘*2¹)=4

[0218] RSI(s0 )=4−4=0

[0219] Session s0 is enqueued in the NSL[0] of group SG1. The result is shown in FIG. 7e.

[0220] /** procedure update VT with VTF( ) **/

[0221] VT is updated with VTF:

[0222] g=1; SG1 is the first group with non-empty CSL or NSL[0]

[0223] VTg=(└VT*2⁻¹┘+1)*2¹=(2+1)*2=6

[0224] VT is equal to 4; VT+VTF=4+2=6

[0225] Lastg=1

[0226] NewVT=6

[0227] VTF=2−(6−4)=0

[0228] VT=6

[0229] NSL(SG0)[0] is swapped to CSL(SG0) and NSL(SG0)[0] is emptied

[0230] NSL(SG1)[0] is swapped to CSL(SG1) and NSL(SG1)[0] is emptied

[0231] The result is shown in FIG. 7f.

[0232] /** procedure HDRRenque **/

[0233] In the mean time, other packets have been received as shown in FIG. 8a.

[0234] packets p5 to p8 and p17 to p20 from session s1 with rate R1=160 B/s

[0235] packets p9 to p12 from session s2 with rate R2=80 B/s

[0236] packets p13 to p16 from session s3 with rate R3=40 B/s

[0237] Packet p5 is enqueued in session s1

[0238] TotalRate=80+160=240

[0239] Phi=320/160=2

[0240] RSI(s1)=0; initialised as such for the very first packet of a session

[0241] RSI(s1)=0+2=2

[0242] Group=└log₂(2/2)┘=0; session s1 will be entered into SG0

[0243] ASI=2*2⁰=2

[0244] RSI(s1)=2−2=0

[0245] s1 is enqueued in NSL[0] of SG0.

[0246] Packet p6 belonging to session s1 arrives and is enqueued in session s1.

[0247] Packet p7 belonging to session s1 arrives and is enqueued in session s1.

[0248] Packet p8 belonging to session s1 arrives and is enqueued in session s1.

[0249] The result is shown in FIG. 8a.

[0250] Packet p9 is enqueued in session s2

[0251] TotalRate=240+80=320

[0252] Phi=320/80=4

[0253] RSI(s2)=0; initialised as such for the very first packet of a session

[0254] RSI(s2)=0+4=4

[0255] Group=└log₂(4/2)┘=1; session s2 will be entered into SG1

[0256] ASI=2*2¹=4

[0257] RSI(s2)=4−4=0

[0258] s2 is enqueued in NSL[0] of SG1.

[0259] Packet p10 belonging to session s2 arrives and is enqueued in session s2.

[0260] Packet p11 belonging to session s2 arrives and is enqueued in session s2.

[0261] Packet p12 belonging to session s2 arrives and is enqueued in session s2.

[0262] The result is shown in FIG. 8a.

[0263] Packet p13 is enqueued in session s3

[0264] TotalRate=320+40=360

[0265] Phi=320/40=8

[0266] RSI(s3)=0; initialised as such for the very first packet of a session

[0267] RSI(s3)=0+8=8

[0268] Group=└log₂(8/2)┘=2; session s3 will be entered into SG2

[0269] ASI=2*2²=8

[0270] RSI(s3)=8−8=0

[0271] S3 is enqueued in NSL[0] of SG2.

[0272] Packet p14 belonging to session s3 arrives and is enqueued in session s3.

[0273] Packet p15 belonging to session s3 arrives and is enqueued in session s3.

[0274] Packet p16 belonging to session s3 arrives and is enqueued in session s3.

[0275] The result is shown in FIG. 8a.

[0276] Packet p17 belonging to session s1 arrives and is enqueued in session s1.

[0277] Packet p18 belonging to session s1 arrives and is enqueued in session s1.

[0278] Packet p19 belonging to session s1 arrives and is enqueued in session s1.

[0279] Packet p20 belonging to session s1 arrives and is enqueued in session s1.

[0280] The result is shown in FIG. 8a.

[0281] /** procedure scheduler **/

[0282] The scheduler starts all over again, starting with the situation of FIG. 8a.

[0283] g=1; SG1 is the fastest (and the only) group with CSL non-empty.

[0284] There is only 1 session s0 in SG1 from which packets need to be transmitted. This session s0 is selected.

[0285] RSI(s0 )=0

[0286] Packet p3 is dequeued from s0, its length is obtained, and

[0287] VTF=0+320/(360*2)=0.44

[0288] Packet p3 is transmitted, and packet p4 becomes the next packet to be transmitted.

[0289] Phi=320/80=4[s].

[0290] RSI(s0 )=0+4=4[s].

[0291] Newg=findgroup (4) =└log₂(4/2)┘=└log₂2┘=1

[0292] ASI=actualservice (1, 1)=2*((└6*2⁻¹┘+1)*2¹−└6*2⁻¹┘*2¹)=4

[0293] RSI(s0 )=4−4=0

[0294] Session s0 is enqueued in the NSL[0] of group SG1. The result is shown in FIG. 8b.

[0295] /** procedure update VT with VTF( ) **/

[0296] VT is updated with VTF:

[0297] g=0; SG0 is the first group with non-empty CSL or NSL[0]

[0298] VTg=(└VT*2⁻⁰┘+1)*2⁰=7

[0299] VT is equal to 6; └VT+VTF=┘6+0.44┘=6<7, so updating is stopped

[0300] /** procedure HDRRenque **/

[0301] Packet p21 belonging to session s0 arrives and is enqueued in session s0.

[0302] Packet p22 belonging to session s0 arrives and is enqueued in session s0.

[0303] Packet p23 belonging to session s0 arrives and is enqueued in session s0.

[0304] Packet p24 belonging to session s0 arrives and is enqueued in session s0.

[0305] The result is shown in FIG. 8c.

[0306] /** procedure scheduler **/

[0307] All CSL are empty, but not all NSL are empty.

[0308] /** procedure increase VT( ) **/

[0309] g=0; SG0 is the first group with non-empty CSL or NSL[0]

[0310] newVT=(└6*2⁻⁰┘+1)*2⁰=7

[0311] lastg=0

[0312] VTF=0

[0313] VT=7

[0314] NSL(SGO)[0] is swapped to CSL(SG0) and NSL(SG0)[0] is emptied

[0315] The result is shown in FIG. 9.

[0316] /** procedure scheduler **/

[0317] The scheduler starts all over again, starting with the situation of FIG. 9.

[0318] g=0; SG0 is the fastest group with non-empty CSL

[0319] s=s1 is considered

[0320] RSI(s1)=0

[0321] Packet p5 is considered.

[0322] VTF=0+320/(360*2)=0.44

[0323] Packet p5 is transmitted. The result is shown in FIG. 10. Session s1 is not idle yet.

[0324] Packet p6 of s1 becomes the next to be transmitted. p=p6 of s1 in SG0.

[0325] Phi=320/160=2

[0326] RSI(s1)=0+2=2

[0327] Newg=log₂(2/2)=log₂1=0

[0328] ASI=actualservice(0, 0)=2*((└7*2⁻⁰┘+1)*2⁰)−└7*2⁻⁰┘*2⁰)=2*1=2

[0329] RSI(s1)=2−2=0

[0330] Session s1 is enqueued in NSL[0] of SG0. The result is shown in FIG. 11.

[0331] /** procedure update VT with VTF( ) **/

[0332] VT is updated with VTF:

[0333] g=0; SG0 is the first group with non-empty CSL or NSL

[0334] VTg=(└VT*2⁻⁰┘+1)*2⁰=8

[0335] └VT+VT┘=└7+0.44┘=7<8, thus updating of VT is stopped

[0336] /** procedure scheduler **/

[0337] All CSL are empty, but not all NSL are empty

[0338] /** procedure increase VT( ) **/

[0339] g=0; SG0 is the fastest group with non-empty NSL[0]

[0340] newVT=(└7*2⁻⁰┘+1)*2⁰=8

[0341] lastg=3

[0342] VTF=0

[0343] VT=8

[0344] For SG0: NSL(SG0)[0] is transferred to CSL(SG0); NSL(SG0)[0] is emptied

[0345] For SG1: NSL(SG1)[0] is transferred to CSL(SG1); NSL(SG1)[0] is emptied

[0346] For SG2: NSL(SG2)[0] is transferred to CSL(SG2); NSL(SG2)[0] is emptied

[0347] The result is shown in FIG. 12.

[0348] /** procedure scheduler **/

[0349] The scheduler starts all over again, starting with the situation of FIG. 12.

[0350] g=0; SG0 is the fastest group with non-empty CSL

[0351] s=s1 is considered

[0352] RSI(s1)=0

[0353] Packet p6 is considered.

[0354] VTF=0+320/(360*2)=0.44

[0355] Packet p6 is transmitted. Session s1 is not idle yet. Packet p7 of s1 becomes the next to be transmitted. p=p7 of s1 in SG0.

[0356] Phi=320/160=2

[0357] RSI(s1)=0+2=2

[0358] Newg=1092(2/2)=0

[0359] ASI=actualservice (0, 0)=2* ((└8*2⁻⁰┘+1)*2⁰)−└8*2⁻⁰┘*2⁻⁰)=2

[0360] RSI(s1)=2−2=0

[0361] Session s1 is enqueued in NSL[0] of SG0. The result is shown in FIG. 13.

[0362] /** procedure updateVTwithVTF( ) **/

[0363] VT is updated with VTF:

[0364] g=0; SG0 is the first group with non-empty CSL or NSL;

[0365] VTg.=(└8 *2⁻⁰+1) *2⁰=9

[0366] └VT+VTF┘=└8+0.44┘=8<9, thus stop updating VT

[0367] /** procedure scheduler **/

[0368] The scheduler starts all over again, starting with the situation of FIG. 13.

[0369] g=1; SG1 is the fastest group with non-empty CSL

[0370] s=s0 is considered

[0371] RSI (s0 )=0

[0372] Packet p4 is considered.

[0373] VTF=0.44+320/(360*2)=0.89

[0374] Packet p4 is transmitted. Session s0 is not idle-yet. Packet p21 of s0 becomes the next to be transmitted. p=p21 of s0 in SG1.

[0375] Phi=320/80=4

[0376] RSI(s0 )=0+4=4

[0377] Newg=1092(4/2)=1

[0378] ASI=actualservice (1, 1)=2*((└8*2⁻¹┘+1)*2¹)−(8*2⁻¹)*2¹)=4

[0379] RSI(s0 )=4−4=0

[0380] Session s0 is enqueued in NSL[0] of SG1. The result is shown in FIG. 14.

[0381] /** procedure updateVTwithVTF( ) **/

[0382] VT is updated with VTF:

[0383] g=0; SG0 is the first group with non-empty CSL or NSL[0];

[0384] VTg=(└8*2⁻⁰┘+1)*2⁰=9

[0385] └VT+VTF┘=└8+0.89┘=8<9, thus updating of VT is stopped

[0386] /** procedure scheduler **/

[0387] The scheduler starts all over again, starting with the situation of FIG. 14.

[0388] g=1; SG1 is the fastest group with non-empty CSL

[0389] s=s2 is considered

[0390] RSI (s2)=0

[0391] Packet p9 is considered.

[0392] VTF=0.89+320/(360*2)=1.33

[0393] Packet p9 is transmitted. Session s2 is not idle yet. Packet p10 of s2 becomes the next to be transmitted. p=p10 of s2 in SG1.

[0394] Phi=320/80=4

[0395] RSI(s0 )=0+4=4

[0396] Newg=log₂(4/2)=1

[0397] ASI=actualservice (1, 1)=2*((└8*2⁻¹┘+1)*2¹)−(8*2⁻¹)*2¹)=4

[0398] RSI(s0 )=4−4=0

[0399] Session s2 is enqueued in NSL[0] of SG1. The result is shown in FIG. 15a.

[0400] /** procedure update VT with VTF( ) **/

[0401] VT is updated with VTF:

[0402] g=0; SG0 is the first group with non-empty CSL or NSL[0]

[0403] VTg=(└8*2⁻¹┘+1)*2¹=(4+1)*2=10

[0404] └VT+VTF=┘8+1.33┘=9<10, thus updating of VT is stopped.

[0405] /** procedure scheduler **/

[0406] The scheduler starts all over again, starting with the situation of FIG. 15a.

[0407] g=2; SG2 is the fastest group with non-empty CSL

[0408] s=s3 is considered

[0409] RSI (s3)=0

[0410] Packet p13 is considered.

[0411] VTF=1.33+320/(360*2)=1.78

[0412] Packet p13 is transmitted. Session s3 is not idle yet. Packet p14 of s3 becomes the next to be transmitted. p=p14 of s3 in SG2.

[0413] Phi=320/160=2

[0414] RSI(s1)=0+2=2

[0415] Newg=log₂(2/2)=0

[0416] ASI=actualservice (0, 0)=2*((└8*2⁻⁰┘+1)*2⁰)−(8*2⁻⁰)*2⁰)=2

[0417] RSI(s1)=2−2=0

[0418] Session s3 is enqueued in NSL[0] of SG2. The result is shown in FIG. 15b.

[0419] /** procedure updateVTwithVTF( ) **/

[0420] VT is updated with VTF:

[0421] g=0; SG0 is the first group with non-empty CSL or NSL[0];

[0422] VTg=(└8*2⁻⁰┘+1)*2⁰=9

[0423] └VT+VTF┘=└8+1.78┘=9

[0424] lastg=0

[0425] newVT=9

[0426] VTF=1.78−(9−8)=0.78

[0427] VT=9

[0428] NSL(SG0)[0] is swapped to CSL(SG0) and NSL(SG0)[0] is emptied. The result is shown in FIG. 15c.

[0429] /** procedure scheduler **/

[0430] The scheduler starts all over again, starting with the situation of FIG. 15c.

[0431] g=0; SG0 is the fastest group with non-empty CSL

[0432] s=s1 is considered

[0433] RSI (s1)=0

[0434] Packet p7 is considered.

[0435] VTF=0.78+320/(360*2)=1.22

[0436] Packet p7 is transmitted. Session s1 is not idle yet. Packet p8 of s1 becomes the next to be transmitted. p=p8 of s1 in SG0.

[0437] Phi=320/160=2

[0438] RSI(s1)=0+2=2

[0439] Newg=log₂(2/2)=0

[0440] ASI=actualservice (0, 0)=2*((└9*2⁻⁰┘+1)*2⁰)−└9*2⁻⁰┘*2⁰)=2

[0441] RSI(s1)=2−2=0

[0442] Session s1 is enqueued in NSL[0] of SG0. The result is shown in FIG. 15d.

[0443] /** procedure updateVTwithVTF( ) **/

[0444] VT is updated with VTF:

[0445] g=0; SG0 is the first group with non-empty CSL or NSL[0];

[0446] VTg=(└9*2⁰┘+1)*2⁰=10

[0447] └VT+VTF┘=└9+1.22┘=10

[0448] Lastg=1

[0449] N wVT=10

[0450] VTF=1.22−(10−9)=0.22

[0451] VT=10

[0452] For SG0: NSL(SG0)[0] is transferred to CSL(SG0); NSL(SG0)[0] is emptied

[0453] For SG1: NSL(SG1)[0] is transferred to CSL(SG1); NSL(SG1)[0] is emptied

[0454] The result is shown in FIG. 15e.

[0455] /** procedure scheduler **/

[0456] The scheduler starts all over again, starting with the situation of FIG. 15e.

[0457] g=0; SG0 is the fastest group with non-empty CSL

[0458] s=s1 is considered

[0459] RSI (s1)=0

[0460] Packet p8 is considered.

[0461] VTF=0.22+320/(360*2)=0.67

[0462] Packet p8 is transmitted. Session s1 is not idle yet. Packet p17 of s1 becomes the next to be transmitted. p=p17 of s1 in SG0.

[0463] Phi=320/160=2

[0464] RSI(s1)=0+2=2

[0465] Newg=log₂(2/2)=0

[0466] ASI=actualservice (0, 0)=2* ((└10*2⁻⁰┘+1)*2⁰)−└10*2⁻⁰ ┘j*2 ⁰)=2

[0467] RSI(s1)=2−2=0

[0468] Session s1 is enqueued in NSL[0] of SG1. The result is shown in FIG. 15f.

[0469] /** procedure updateVTwithVTF( ) **/

[0470] VT is updated with VTF:

[0471] g=0; SG0 is the first group with non-empty CSL or NSL;

[0472] VTg (└10*2⁻⁰┘+1)*2⁰=11

[0473] └VT+VTF┘=└10+0.67┘=10<11, thus updating of VT is stopped.

[0474] /** procedure scheduler **/

[0475] The scheduler starts all over again, starting with the situation of FIG. 15f.

[0476] g=1; SG1 is the fastest group with non-empty CSL

[0477] s=s2 is (for example) considered

[0478] RSI (s2)=0

[0479] Packet p10 is considered.

[0480] VTF=0.67+320/(360*2)=1.11

[0481] Packet p10 is transmitted. Session s2 is not idle yet. Packet p11 of s2 becomes the next to be transmitted. p=p11 of s2 in SG1.

[0482] Phi=320/80=4

[0483] RSI(s2)=4

[0484] Newg=log₂(4/2)=1

[0485] ASI=actualservice (1, 1)=2*((└10*2⁻¹┘+1)*2¹)−└10*2⁻¹┘*2¹)=4

[0486] RSI(s0 )=4−4=0

[0487] Session s2 is enqueued in NSL[0] of SG1. The result is shown in FIG. 15g.

[0488] /** procedure updateVTwithVTF( ) **/

[0489] VT is updated with VTF:

[0490] g=0; SG0 is the first group with non-empty CSL or NSL[0];

[0491] VTg=(└10*2⁻⁰┘+1)*2⁰=11

[0492] └VT+VTF┘=└10+1.11┘=11

[0493] Lastg=0

[0494] NewVT=11

[0495] VTF=1.11−(11−10)=0.11

[0496] VT=11

[0497] For SG0: NSL(SG0)[0] is transferred to CSL(SG0); NSL(SG0)[0] is emptied

[0498] The result is shown in FIG. 15h.

[0499] /** procedure scheduler **/

[0500] The scheduler starts all over again, starting with the situation of FIG. 15h.

[0501] g=0; SG0 is the fastest group with non-empty CSL

[0502] s=s1 is considered

[0503] RSI (s1)=0

[0504] Packet p17 is considered.

[0505] VTF=0.11+320/(360*2)=0.56

[0506] Packet p17 is transmitted. Session s1 is not idle yet. Packet p18 of s1 becomes the next to be transmitted. p=p18 of s1 in SG0.

[0507] Phi=320/160=2

[0508] RSI(s1)=0+2=2

[0509] Newg=log₂(2/2)=0

[0510] ASI=actualservice (0, 0)=2*((└11*2⁻⁰┘+1)*2⁰)−└11*2⁻⁰┘2⁰)=2

[0511] RSI(s1)=2−2=0

[0512] Session s1 is enqueued in NSL[0] of SG0. The result is shown in FIG. 15i.

[0513] /** procedure updateVTwithVTF( ) **/

[0514] VT is updated with VTF:

[0515] g=0; SG0 is the first group with non-empty CSL or NSL[0];

[0516] VTg=(└11*2⁻⁰┘+1)*2⁰12

[0517] └VT+VTF┘=└11+0.56┘=11<12, thus updating of VT is stopped.

[0518] /** procedure scheduler **/

[0519] The scheduler starts all over again, starting with the situation of FIG. 15i.

[0520] g=1; SG1 is the fastest group with non-empty CSL

[0521] s=s0 is considered

[0522] RSI (s0 )=0

[0523] Packet p21 is considered.

[0524] VTF=0.56+320/(360*2)=1

[0525] Packet p21 is transmitted. Session s0 is not idle yet. Packet p22 of s0 becomes the next to be transmitted. p=p22 of s0 in SG0.

[0526] Phi=320/80=4

[0527] RSI(s0 )=0+4=4

[0528] Newg=log₂(4/2)=1

[0529] ASI=actualservice (1,1)=2*((└11*2⁻¹┘+1)*2¹)−└11*2⁻¹┘*2¹)=4

[0530] RSI(s0 )=4−4=0

[0531] Session s0 is enqueued in NSL[0] of SG1. The result is shown in FIG. 16.

[0532] /** procedure updateVTwithVTF( ) **/

[0533] VT is updated with VTF:

[0534] g=0; SG0 is the first group with non-empty CSL or NSL[0];

[0535] VTg=(└11*2⁻⁰┘+1)*2⁰=12

[0536] └VT+VTF┘=└11+1┘=12

[0537] lastg=2

[0538] newVT=12

[0539] VTF=1−(12−11)=0

[0540] VT=12

[0541] For SG0: NSL(SG0)[0] is transferred to CSL(SG0); NSL(SG0)[0] is emptied

[0542] For SG1: NSL(SG1)[0] is transferred to CSL(SG1); NSL(SG1)[0] is emptied

[0543] For SG2: NSL(SG2)[0] is transferred to CSL(SG2); NSL(SG2)[0] is emptied.

[0544] The result is shown in FIG. 17.

[0545] /** procedure scheduler **/

[0546] The scheduler starts all over again, starting with the situation of FIG. 17.

[0547] The simulation may be continued the same way, by enqueueing data packets which arrive, and by scheduling, according to the present invention, data packets to be transmitted.

[0548] An example of a circuit in accordance with an embodiment of the present invention will be described with reference to FIG. 18 for a receiver/transmitter circuit 40. This circuit 40 may be constructed as a VLSI chip around an embedded microprocessor 27 such as an ARM7TDMI core designed by ARM Ltd., UK which may be synthesized onto a single chip with the other components shown. A zero wait state SRAM memory 22 may be provided on-chip as well as a cache memory 24. The SRAM memory 22 may be used for providing the various queues, registers and read and write queues described above. If on-chip memory is not large enough to store the packet data in the queues, alternative storage means may be used, e.g. off-chip memory 34. The interface to a packet switched network 33 is provided by block 31. Packet data received by block 31 is passed to the processor 27 for processing. An on-chip buffer 32 may be used to decouple the processor 27 from data transfer through the interface 31. A counter/timer block 28 may be provided as well as an interrupt controller 26. Software programs may be stored in an internal ROM (read only memory) 23. Access to the off-chip (e.g. DRAM) memory 34 may be provided through an external bus interface 25 with address, data and control busses. The various blocks of circuit 40 are linked by a suitable bus system 30 which is shown only schematically in the figure.

[0549] The session control mechanisms of the present invention may be implemented as software to run on processor 27. The procedures described above may be written as computer programs in a suitable computer language such as C and then compiled for the specific processor in the embedded design. For example, for the embedded ARM core VLSI described above the software may be written in C and then compiled using the ARM C compiler and the ARM assembler.

[0550] Accordingly, the present invention also includes software computer program products for carrying out any of the methods of the present invention when run on a suitable processing engine as well as data carriers for storing executable computer programs for carrying out any of the methods of the present invention. However, it is important that those skilled in the art will appreciate that the mechanisms and methods of the present invention are capable of being distributed as a program product in a variety of forms, and that the present invention applies equally regardless of the particular type of signal bearing media used to actually carry out the distribution. Examples of computer readable signal bearing media include: recordable type media such as floppy disks and CD ROMs and transmission type media such as digital and analogue communication links.

[0551] Another example of a circuit in accordance with an embodiment of the present invention will be described with reference to FIG. 19 for a scheduling circuit 41. This circuit 41 may be constructed as part of VLSI chip handling the traffic management function for one or more transmission lines in a network node. The scheduling logic 46 receives packet descriptor information from a different part of the VLSI using a bus signal DescriptorIn. This descriptor information contains packet size, session number, destination transmission line and other information describing the packet such as the location of the buffers that hold the packet data. The circuit may indicate that it is ready to receive new descriptors using a hand shake signal DescriptorInBusy, if necessary. Scheduling decisions are indicated by transmitting the descriptor of the packet that is sent out through the bus signal DescriptorOut. The scheduling logic 46 uses memory 43 to store and retrieve the descriptors together with session-queue next-pointers, memory 44 to store and retrieve session information and session-list next-pointers, and memory 45 to store and retrieve service-group information. These memories could be stored on-chip or off-chip. If some of these memories are also used by other functions on the chip, then an arbiter could be employed to arbitrate the requests from these various functional units.

[0552] The scheduling logic, that is formulated in the algorithmic description above, is implemented using a hardware design language such as VHDL or Verilog. The scheduling logic could perform the scheduling for multiple transmission lines, in which case memory 45 holds for each transmission line a distinct set of service-group information. The scheduler uses information that describes whether a particular link is idle or busy, TransmissionLinkStatus, to decide if and for what link it must schedule a packet.

[0553] The scheduler is configured by an embedded or off-chip host processor 42 to which it communicates using a system bus.

[0554] Those skilled in the art will appreciate that the hardware represented in FIG. 21 may vary for specific applications.

[0555] There have been described and illustrated herein several embodiments of a method and apparatus for fair queueing of data packets. While particular embodiments of the invention have been described, it is not intended that the invention be limited thereto, as it is intended that the invention be as broad in scope as the art will allow and that the specification be read likewise. It will therefore be appreciated by those skilled in the art that yet other modifications could be made to the provided invention without deviating from its spirit and scope as claimed. 

1. A packet scheduling method comprising: enqueuing incoming data packets in sessions, storing the sessions in sequential order in service-groups, each service-group being assigned a nominal service-interval in which time a data packet is to be transmitted, the nominal service-interval of one service-group being faster than the nominal service-interval of another service-group, within one service-group, servicing one session until the nominal service-interval of any of the service-groups where there is at least one data packet to be sent is exceeded.
 2. A packet scheduling method according to claim 1, each data packet having a priority for selection, the method further comprising: if the nominal service-interval of a service-group is exceeded and if a data packet from that service-group is not selected, then its priority for a next selection is changed such as to give it a higher priority.
 3. A packet scheduling method according to claim 1, wherein: the service-interval is measured in accordance with virtual time, which virtual time is incremented in accordance with the time expected for transmission of the next packet to be sent.
 4. A packet scheduling method according to claim 1, wherein: the service-interval is measured in accordance with virtual time, which virtual time is incremented in accordance with the time for transmission of the latest packet sent.
 5. A packet scheduling method according to claim 1, each service-group comprising a current session list and at least one new session list, the method further comprising: holding a virtual time value, in at least one of the service-groups, holding at least one session having at least a head-of-session data packet, the session requiring a required service-interval for its head-of-session data packet, sessions requiring different service-intervals for their head-of-session data packets being held in different service-groups, at integer values of the virtual time value, swapping the new session lists into the current session lists for service-groups which may receive service at that virtual time value, if the current session list for that service-group is empty, and increasing a MissedSwaps counter for that service-group if the current session list for that service-group was not empty, transmitting the head-of-session data packet from a session in a current session list, scheduling transmission of the next data packet from that session based on the required service-interval of the previous data packet and a service interval it was actually given, and on the value of the MissedSwaps counter, increasing the virtual time value and repeating the transmitting and increasing steps as long as the virtual time does not reach a next integer value, otherwise repeating the swapping step.
 6. A packet scheduling apparatus, comprising: an input device for receiving incoming data packets belonging to at least one session, a bank of memories comprising memory sets for storing the incoming data packets, the memory sets having a nominal service-interval in which time a data packet is to be transmitted, the nominal service-interval of one memory set being faster than the nominal service-interval of another memory set, an output device for transmitting the stored data packets, a processing element linked to the input device, the output device and the bank of memories for scheduling sessions for being serviced until the nominal service-interval of any of the memory sets where there is at least one data packet to be sent, is exceeded.
 7. A packet scheduling apparatus according to claim 6, each data packet having a priority value for selection, the apparatus furthermore comprising: a priority switcher for changing the priority value of a data packet for a next selection such as to give it a higher priority value if the nominal service-interval of a memory set is exceeded and if a data packet stored in that memory set is not selected.
 8. A packet scheduling apparatus according to claim 6, further comprising: a timing unit for measuring the service-interval in accordance with virtual time, which virtual time is incremented in accordance with the time expected for transmission of the next packet to be sent.
 9. A packet scheduling apparatus according to claim 8, each memory set having a current session list memory and at least one new session list memory for holding data packets, the apparatus further comprising: input means for inputting arriving data packets into the memory sets, data packets having a required service-interval, a timing unit for holding a virtual time value, means for swapping the content of the new session list memories into the current session list memories at integer values of the virtual time value, for memory sets which may receive service at that virtual time value, if the current session list memory for that memory set is empty, and a MissedSwaps counter for that memory set to be increased if the current session list memory for that memory set was not empty, means for transmitting data packet from a current session list memory, and a scheduler for scheduling transmission of a next data packet from that memory set based on the required service-interval of the next data packet to be sent, and on the value of the MissedSwaps counter.
 10. A packet scheduling apparatus according to claim 6, further comprising: a timing unit for measuring the service-interval in accordance with virtual time, which virtual time is incremented in accordance with the time for transmission of the latest packet sent.
 11. A packet scheduling apparatus according to claim 6, further comprising: a timing unit for measuring the service-interval in accordance with virtual time, which virtual time is incremented in accordance with the time expected for transmission of the next packet to be sent.
 12. A packet scheduling apparatus according to claim 10, each memory set having a current session list memory and at least one new session list memory for holding data packets, the apparatus further comprising: input means for inputting arriving data packets into the memory sets, data packets having a required service-interval, a timing unit for holding a virtual time value, means for swapping the content of the new session list memories into the current session list memories at integer values of the virtual time value, for memory sets which may receive service at that virtual time value, if the current session list memory for that memory set is empty, and a MissedSwaps counter for that memory set to be increased if the current session list memory for that memory set was not empty, means for transmitting data packet from a current session list memory, and a scheduler for scheduling transmission of a next data packet from that memory set based on the required service-interval of the previous data packet and a service interval it was actually given, and on the value of the MissedSwaps counter. 